Zum Hauptinhalt springen

Deal-Produkte

Ein Deal-Produkt verbindet ein Produkt (aus dem Katalog — siehe Produkte) mit einem Deal — inkl. einer bestimmten Menge und einem bestimmten Stückpreis. Preis und Produktname werden zum Zeitpunkt der Verknüpfung eingefroren (Snapshot), sodass spätere Änderungen am Katalog vergangene Deals nicht überschreiben.

Ressourcenstruktur

AttributTypPflichtBeispielHinweise
product_idintegerJa (beim Anlegen)10ID eines bestehenden Produkts.
deal_idintegerJa (beim Anlegen)25ID des Deals, der das Produkt erhält.
quantityintegerNein2Default 1.
unit_amount_in_centsintegerNein5000Default = amount_in_cents des Produkts.
product_namestringNeinPremium-AboSnapshot. Default = Produktname.
product_identifierstringNeinSKU-ABC-001Snapshot. Default = Produkt-Identifier.

Alle nachfolgenden Endpoints gehen aus von:

{base_url} = https://app.woofedcrm.com
{account_id} = 1

Deal-Produkt erstellen

POST /api/v1/accounts/{account_id}/deal_products

Hängt ein Produkt an einen Deal.

Body

{
"product_id": 1,
"deal_id": 1,
"quantity": 2
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deal_products" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"product_id": 1,
"deal_id": 1,
"quantity": 2
}'

Beispiel-Antwort — 201 Created

Die Antwort enthält außerdem das zum Deal-Produkt gehörende Product und Deal.

{
"id": 17,
"product_id": 1,
"deal_id": 1,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"unit_amount_in_cents": 1000035,
"product_identifier": "SNS895SASXVDW",
"product_name": "Auto",
"total_amount_in_cents": 2000070,
"quantity": 2,
"account_id": 1,
"product": {
"id": 1,
"identifier": "SNS895SASXVDW",
"amount_in_cents": 1000035,
"quantity_available": 2,
"description": "Schönes Auto",
"name": "Auto",
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-12T18:21:03Z",
"updated_at": "2025-01-12T18:21:03Z",
"account_id": 1
},
"deal": {
"total_deal_products_amount_in_cents": 2000070,
"contact_id": 1,
"stage_id": 1,
"pipeline_id": 1,
"id": 1,
"name": "Deal 1",
"status": "open",
"custom_attributes": {},
"created_at": "2025-01-12T18:20:50Z",
"updated_at": "2025-01-15T10:30:00Z",
"position": 1,
"created_by_id": null,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1
}
}

Antwortfelder

FeldBeschreibung
idNumerische ID der Verknüpfung Deal-Produkt.
unit_amount_in_centsDefault vom Produkt, falls nicht übergeben.
product_name, product_identifierSnapshots des Produkts zum Zeitpunkt der Verknüpfung.

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
404Produkt oder Deal existiert in diesem Account nicht.
422product_id / deal_id fehlt oder quantity ungültig.

Deal-Produkt abrufen

GET /api/v1/accounts/{account_id}/deal_products/{id}

Liest eine einzelne Deal-Produkt-Verknüpfung.

Beispiel-Request

curl -X GET "https://app.woofedcrm.com/api/v1/accounts/1/deal_products/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER"

Beispiel-Antwort — 200 OK

Die Antwort enthält außerdem das zum Deal-Produkt gehörende Product und Deal.

{
"id": 1,
"product_id": 1,
"deal_id": 1,
"created_at": "2025-01-12T18:21:03Z",
"updated_at": "2025-01-12T18:21:03Z",
"unit_amount_in_cents": 150000,
"product_identifier": "CAR-15632",
"product_name": "Auto",
"total_amount_in_cents": 150000,
"quantity": 1,
"account_id": 1,
"product": {
"id": 1,
"identifier": "CAR-15632",
"amount_in_cents": 150000,
"quantity_available": 2,
"description": "Schönes Auto",
"name": "Auto",
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-12T18:21:00Z",
"updated_at": "2025-01-12T18:21:00Z",
"account_id": 1
},
"deal": {
"total_deal_products_amount_in_cents": 150000,
"contact_id": 1,
"stage_id": 1,
"pipeline_id": 1,
"id": 1,
"name": "Deal 1",
"status": "open",
"custom_attributes": {},
"created_at": "2025-01-12T18:20:50Z",
"updated_at": "2025-01-12T18:21:03Z",
"position": 1,
"created_by_id": null,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1
}
}

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
404Deal-Produkt nicht gefunden.

Deal-Produkt aktualisieren

PUT /api/v1/accounts/{account_id}/deal_products/{id}

Aktualisiert Menge, Stückpreis oder den Snapshot von Name/Identifier einer bestehenden Verknüpfung.

Body

{
"quantity": 3,
"unit_amount_in_cents": 150000,
"product_name": "Auto",
"product_identifier": "CAR-15632"
}

Beispiel-Request

curl -X PUT "https://app.woofedcrm.com/api/v1/accounts/1/deal_products/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"quantity": 3,
"unit_amount_in_cents": 150000
}'

Beispiel-Antwort — 200 OK

Die Antwort enthält außerdem das zum Deal-Produkt gehörende Product und Deal.

{
"id": 1,
"product_id": 1,
"deal_id": 1,
"created_at": "2025-01-12T18:21:03Z",
"updated_at": "2025-01-20T11:42:18Z",
"unit_amount_in_cents": 150000,
"product_identifier": "CAR-15632",
"product_name": "Auto",
"total_amount_in_cents": 450000,
"quantity": 3,
"account_id": 1,
"product": {
"id": 1,
"identifier": "CAR-15632",
"amount_in_cents": 150000,
"quantity_available": 2,
"description": "Schönes Auto",
"name": "Auto",
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-12T18:21:00Z",
"updated_at": "2025-01-12T18:21:00Z",
"account_id": 1
},
"deal": {
"total_deal_products_amount_in_cents": 450000,
"contact_id": 1,
"stage_id": 1,
"pipeline_id": 1,
"id": 1,
"name": "Deal 1",
"status": "open",
"custom_attributes": {},
"created_at": "2025-01-12T18:20:50Z",
"updated_at": "2025-01-20T11:42:18Z",
"position": 1,
"created_by_id": null,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1
}
}

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
404Deal-Produkt nicht gefunden.
422quantity oder unit_amount_in_cents ungültig.

Verwandte Endpoints

  • Produkt abrufen — um die id eines deal_product zu finden, rufen Sie das Produkt mit GET /api/v1/accounts/{account_id}/products/{id} ab. Die Antwort enthält ein Array deal_products mit allen Verknüpfungen dieses Produkts und allen Feldern (id, product_id, deal_id, …).
  • Deal abrufen — alternativ rufen Sie den Deal mit GET /api/v1/accounts/{account_id}/deals/{id} ab. Die Antwort enthält ebenfalls ein Array deal_products mit allen Verknüpfungen dieses Deals — verwenden Sie die id daraus, um Deal-Produkt abrufen oder Deal-Produkt aktualisieren aufzurufen.